package com.oig.auth.api;

import com.oig.auth.api.factory.ResourceFallbackFactory;
import com.oig.sys.auth.vo.ResourceVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "resourceService", value = "sys-auth-server",path = "/resource", fallbackFactory = ResourceFallbackFactory.class)
public interface ResourceService {

    /**
     * 根据资源id获取资源配置
     */
    @PostMapping(value = "/info/{resourceId}")
    ResourceVo info(@PathVariable("resourceId") Integer resourceId) ;

    @PostMapping(value = "/getByCode")
    ResourceVo getByCode(@RequestParam(value = "resourceCode") String resourceCode, @RequestParam(value = "userId",required=false) Integer userId) ;
}
